package com.zy.algorithm.v2.bean;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class SimpleNode {

    int[] stepEnd; //本次操作后
    List<Integer> opIndex = new ArrayList<>();
    List<Integer> sortedIndex = new ArrayList<>();

    String des;

    public SimpleNode() {
    }

    public int[] getStepEnd() {
        return stepEnd;
    }

    public void setStepEnd(int[] stepEnd) {
        this.stepEnd = stepEnd;
    }

    public List<Integer> getStepStartList() {
        List<Integer> list = new ArrayList<>();
        for (int i : stepEnd) {
            list.add(i);
        }
        return list;
    }


    public List<Integer> getOpIndex() {
        return opIndex;
    }

    public void setOpIndex(List<Integer> opIndex) {
        this.opIndex = opIndex;
    }

    public void addOpIndex(int opIndex) {
        this.opIndex.add(opIndex);
    }

    public void addOpIndex(int... opIndex) {
        for (int i : opIndex) {
            this.opIndex.add(i);
        }
    }

    public List<Integer> getSortedIndex() {
        return sortedIndex;
    }

    public void setSortedIndex(List<Integer> sortedIndex) {
        this.sortedIndex.addAll(sortedIndex);
    }

    public void addSortedIndex(int... opIndex) {
        for (int i : opIndex) {
            this.sortedIndex.add(i);
        }
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }

    @Override
    public String toString() {
        return "SimpleNode{" +
                "stepStart=" + Arrays.toString(stepEnd) +
                ", opIndex=" + opIndex +
                ", des='" + des + '\'' +
                '}';
    }
}
